﻿using StudentProject.DAL;
using StudentProject.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StudentProject.BLL
{
    public class SubjectService
    {
        SubjectServiceDal dal = new SubjectServiceDal();
        //查询显示文本于DGV中
        public List<Subject> GetList()
        {
            return dal.GetList();
        }

        //添加数据
        public bool AddSubjectInfo(Subject subject)
        {
            return dal.AddSubjectInfo(subject) > 0;
        }

        //获取选中数据于文本中
        public Subject LoadSubjectInfo(string pid)
        {
            return dal.LoadSubjectInfo(pid);
        }

        //修改
        public bool UpdateSubjectInfo(Subject subject)
        {
            return dal.UpdateSubjectInfo(subject)>0;
        }
        
        //删除
        public bool Remove(string pid)
        {
            return dal.RemoveSubject(pid)>0;
        }
    }
}
